package com.famdoc.Service.Impl;
import com.famdoc.Mapper.DoctorMapper;
import com.famdoc.Pojo.dto.Result;
import com.famdoc.Pojo.entity.Doctor;
import com.famdoc.Service.DoctorService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

@Service
public class DoctorServiceImpl implements DoctorService {
    @Resource
    private DoctorMapper doctorMapper;

    @Override
    public  Doctor selectDoctor (String account,String password){
        return doctorMapper.selectDoctor(account, password);
    }

    public  void updatePassword(int id,String password){
                doctorMapper.updatePassword(id,password);
    }

    @Override
    public Result updateDoctorInfo(Doctor doctor) {
        if(doctorMapper.updateDoctorInfo(doctor)>0){
            return Result.success("修改个人信息成功！");
        }
        else{
            return Result.error(201,"修改个人信息失败！");
        }
    }

}
